package com.funtl.hello.spring.cloud.web.admin.feign.service;

import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * Created by 胡少东 on 2020/3/4.
 * 通过 @FeignClient("服务名") 注解来指定调用哪个服务。
 * fallback ：在feign标签中添加fallback 增加熔断器，保证系统之间的高可用性，防止服务雪崩。
 */

@FeignClient(value = "hello-spring-cloud-service-admin",fallback = AdminServiceHystrix.class)
public interface AdminService {

    @RequestMapping(value = "hi",method = RequestMethod.GET)
    public String sayHi(@RequestParam(value = "message")String message);
}
